<!DOCTYPE html>
<html lang="en" class="md device-pixel-ratio-3 device-retina device-desktop device-windows support-position-sticky">

<head>
    <meta charset="utf-8" />
    <meta name="theme-color" content="#000000" />
    <meta name="viewport"
        content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1" />
    <link rel="apple-touch-icon" href="favicon.ico" />
    <meta name="apple-mobile-web-app-title" content="坏坏漫画" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="referrer" content="never">
    <!--script type="text/javascript"> 
var system = { 
win: false, 
mac: false,
xll: false
};
var p = navigator.platform;
system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
if (system.win || system.mac || system.xll) {        window.location.href = "http://www.jtjsc.com/";  } 
else 
{}
</script-->
    <script type="text/javascript" src="js/debug.js"></script>
    <link rel="shortcut icon" href="./favicon.ico" />
    <title>坏坏漫画</title>
    <link href="css/main.48b4036a.css" rel="stylesheet">
    <link href="css/aui.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/layer.js"></script>
    <script type="text/javascript" src="js/jquery.lazyload.min.js"></script>
    <script type="text/javascript" src="js/template-web.js"></script>
    <script type="text/javascript" src="js/aui-toast.js"></script>
    <script type="text/javascript" src="js/aui-dialog.js"></script>
    <script type="text/javascript" src="js/config.js" charset="utf-8"></script>
    <div style="display: none;">
    </div>
</head>
<body>
    <div id="root" style="height: 100%;">
        <div id="framework7-root" class="framework7-root ">
            <div class="panel-backdrop"></div>
            <div class="panel panel-left panel-reveal">
                <div id="chapterDirectory" class="page">
                    <div class="page-content">
                        <div class="block-title">目录</div>
                        <div class="no-margin-bottom list virtual-list">
                            <ul id="leftpannel" style="height: 5667.84px;">
                                <li class="bg-color-default text-color-primary"
                                    style="height: 0.48rem; top: 0px; font-size: 110%; font-weight: 700;"><a
                                        class="item-link" href="#">
                                        <div class="item-content">

                                            <div class="item-inner">
                                                <div class="item-title">第1話-&lt;1&gt;</div>
                                            </div>
                                        </div>
                                    </a></li>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-right panel-reveal">
                <!-- 侧边栏 -->
                <div class="page" id="right-page">
                    <script>
                        $("#right-page").load("right-page.html");
                    </script>
                </div>
            </div>
            <div class="view view-main">

                <div class="view view-main">
                    <div class="page page-current" data-name="bookList">
                        <div class="navbar">
                            <div class="navbar-inner sliding">
                                <div class="left"><a class="icon-only link icon-only back"
                                        href="javascript:history.go(-1);"><i class="icon icon-back"></i></a></div>
                                <div class="title">今日更新</div>
                                <div class="right"><a class="icon-big link icon-only" href="/search.html"><i
                                            class="icon material-icons">search</i></a></div>
                            </div>
                        </div>
                        <div class="page-content infinite-scroll-content hide-navbar-on-scroll">
                            <div class="no-margin reader-book-list list">
                                <ul id="aui-media-list">

                                </ul>
                            </div>
                            <div>
                                <p class="reader-infinite-preloader" lastpage="false" onclick="loadMore()"></p>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="framework7-modals"></div>
            <div class="actions-backdrop"></div>
            <div class="dialog-backdrop"></div>
            <div class="dialog dialog-buttons-1 dialog-buttons-vertical reader-copy-modal modal-in"
                style="display: none; margin-top: -372px;">
                <div class="dialog-inner">
                    <div class="dialog-title"></div>
                    <div class="dialog-text"></div>
                    <input id="foo" type="link" value="" readonly="">
                </div>
                <div class="dialog-buttons">
                    <span class="dialog-button dialog-button-bold text-align-center text-color-primary"
                        data-clipboard-action="copy" data-clipboard-target="#foo">复制链接</span>
                </div>
            </div>
            <div class="popover-backdrop"></div>
            <div class="toast">
                <div class="toast-content">
                    <div class="toast-icon"></div>
                    <div class="toast-text"></div>
                    <a class="toast-button"></a>
                </div>
            </div>

        </div>
    </div>
    <script type="text/javascript" src="js/yymh.js"></script>
    <script src="js/clipboard.min.js"></script>
    <script type="text/html" id="booklist">
        {{each list  value i}}
            <li class="">
                <div class="item-content">
                    <div class="item-inner">
                        <div class="-margin-horizontal-sm flex-grow-1"><a class="reader-book reader-book-default reader-book-media" href="book.html?id={{value['id']}}">
                                <div class="">
                                    <div class="cover">
                                        <img src="{{value['image']}}" alt="">
                                        {{if value['mhstatus']==0}}
                                            <span class="status" data-status="serialized">连载</span>
                                        {{/if}}
                                        {{if value['mhstatus']==1}}
                                            <span class="status" data-status="finish">完结</span>
                                        {{/if}}
                                        
                                        {{if value['tjswitch']==1}}
                                            <span class="type" data-type="recommend"></span>
                                        {{/if}}

                                        {{if value['isjingpin']==1}}
                                            <span class="type" data-type="competitive"></span>
                                        {{/if}}

                                        {{if value['xianmian']==1}}
                                            <span class="type" data-type="free_in_limit_time"></span>
                                        {{/if}}
                                    </div>
                                    <span class="name">{{value['title']}}</span>
                                    <p class="desc">{{value['desc']}}....</p>
                                    <div class="footer">
                                        <span class="score"><i class="icon material-icons">star</i> {{value['pingfen']}}</span>
                                        <span class="readCount"><i class="icon material-icons">remove_red_eye</i> {{value['view']}}</span>
                                        <span class="author">作者：{{value['auther']}}</span>
                                        <!-- <span class="badge">{{value['ticai']}}</span> -->
                                    </div>
                                </div>
                            </a></div>
                    </div>
                </div>
            </li>
        {{/each}}
    </script>
    <script type="text/javascript" src="js/aui-scroll.js"></script>
    <script type="text/javascript">
        window.page = 1;
        window.order = 1;
        window.tag = 0;
        window.done = 2;
        window.w = "isnew";
        //window.w = "newest";
        window.loading = false;

        //初始化过滤器事件
        function initFilterEvent() {
            $(".checkcatebox").find("a").click(function () {
                var that = $(this);
                var sv = that.data("value");
                var ty = that.parents(".checkcatebox").data("str");
                removeSel(this);
                if (ty == "order") {
                    window.order = sv;
                } else if (ty == "tag") {
                    window.tag = sv;
                } else if (ty == "done") {
                    window.done = sv;
                }
                window.page = 1;
                $(".aui-media-list").html("");
                initGetCateData();
            });

        }

        //切换样式
        function removeSel(obj) {
            window.page = 1;
            obj.parentNode.getElementsByClassName("button-fill")[0].className = "display-inline-block button button-small";
            obj.className = "display-inline-block button button-fill button-small";
        }



        //加载更多
        function loadMore() {
            if ($('.reader-infinite-preloader').attr('lastpage') == 'false') {
                window.page++;
                initGetCateData();
            }
        }

        //获取分类数据 
        function doGetCateData(cate, w, page, callback) {
            var url = baseApi +'/carton/api/getpage/' + cate + "-" + w + "-" + page;
            appCenter.doHeaderPost(url,null,{'authToken':localStorage.getItem("authToken")},function (data) {
                if (data.code == 0) {
                    callback(data);
                }else{
                    appCenter.showFailToast('请求失败');
                }
            })
        }

        //初始化获取分类数据
        function initGetCateData() {
            $('.reader-infinite-preloader').text('正在加载中...');
            var url = baseApi +'/carton/api/getpage/' +1 + "-" + window.w + "-" + window.page;
            doGetCateData(1, window.w, window.page, function (data) {
                if (data.code == 0) {
                var html = template("booklist", data.data);
                //是否添加
                if (window.page <= 1) {
                    $('#aui-media-list').html(html);
                } else {
                    $('#aui-media-list').append(html);
                }
                //是否到底
                if (data.lastPage) {
                    $('.reader-infinite-preloader').attr('lastpage', 'true');
                    $('.reader-infinite-preloader').text('数据到底');
                } else {
                    $('.reader-infinite-preloader').attr('lastpage', 'false');
                    $('.reader-infinite-preloader').text('点击加载更多');
                }
                $("img.lazy").lazyload();
                }else{
                    appCenter.showFailToast('请求失败');
                }
            });
        }


        //初始化下拉刷新事件
        function initPullRefeshEvent() {
            var scroll = new auiScroll({
                listen: true,
                distance: 50
            }, function (ret) {
                var framework7 = document.getElementById('category');
                console.log(document.documentElement.scrollTop);
                console.log(framework7.scrollTop);

                console.log(document.body.scrollTop);
                if (!window.loading && ret.isToBottom) {
                    window.loading = true;
                    // loadMore();
                    setTimeout(function () {
                        window.loading = false;
                    }, 1000);
                }
                if (ret.scrollTop == '200') {

                    alert(ret.scrollTop);

                }
            });
        }


        //初始化
        $(function () {

            // initFilterEvent();
            initGetCateData();
        });
    </script>


</body>

</html>